package cn.wolfcode.qo;

import cn.wolfcode.enums.CustomerReportEnums;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter
@Getter
public class CustomerReportQuery {
    private String queryName="BUSINESS";
    private Long businessId;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public String getGroupBySql(){
        CustomerReportEnums customerReportEnums = CustomerReportEnums.valueOf(this.queryName);
        return customerReportEnums.getSql();
    }
}
